<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>Document</title>
</head>

<body>
	<script>
		// TODO 4 - 自定义响应头获取
		fetch('http://localhost:8000/info', {
			method: 'post',
			// 请求类型
			headers: {
				'Content-Type': 'application/json'
			},
			body:
				JSON.stringify({ name: 'dh' })
		}).then(res => {
			const headers = res.headers;
			console.log(headers.get('dh'));
			console.log(headers.get('dxy'));
			return res.json()
		}).then(res => {
			console.log(res);
		})
	</script>
</body>

</html>
